﻿using System.Collections.Generic;
using Futaba.SBus.Telemetry.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;

namespace Futaba.SBus.Tests.Telemetry
{
	[TestClass]
	public partial class SlotValueParserTests : BaseTest
	{
		static Sensor[] _sensors;

		public SlotValueParserTests()
		{
			_sensors = SensorFactory.DefaultInstance.GetKnownSensors();
		}

		private SensorParameter GetParameter(IEnumerable<Sensor> sensors, SensorType sensorType, SensorValueType sensorValueType, string parameterName = null)
		{
			return sensors.Single(s => s.SensorType == sensorType).Parameters
				.Single(p => p.ValueType == sensorValueType && p.ParameterName == (parameterName ?? p.ParameterName));
		}

	}
}
